<?php
/**
 * Bazalt
 *
 * PHP versions 5
 *
 * LICENSE:
 * 
 * This library is free software; you can redistribute it
 * and/or modify it under the terms of the GNU Lesser General
 * Public License as published by the Free Software Foundation;
 * either version 2.1 of the License, or (at your option) any
 * later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 * @category   CMS
 * @package    CMS
 * @subpackage Scripts
 * @author     Vitalii Savchuk <esvit666@gmail.com>
 * @author     Alex Slubsky <aslubsky@gmail.com>
 * @license    http://www.opensource.org/licenses/lgpl-license.php LGPL
 * @version    $Revision: 88 $
 * @link       http://www.php-solves.com/
 */

 
 
/**
 * Bazalt
 *
 * @category   CMS
 * @package    CMS
 * @subpackage Scripts
 * @author     Vitalii Savchuk <esvit666@gmail.com>
 * @author     Alex Slubsky <aslubsky@gmail.com>
 * @license    http://www.opensource.org/licenses/lgpl-license.php LGPL
 * @version    $Revision: 88 $
 * @link       http://www.php-solves.com/
 */
class Scripts
{
    public static $collection = null;
    
    public static function using( $file )
    {
        if (!is_string($file)) {
            throw new DataTypeException( __METHOD__ ,'string', gettype($file));
        }          
        
        if( is_null(self::$collection) ){
            self::$collection = Collection::create();
        }

        if( !self::$collection->offsetExists( $file ) ) {
            self::$collection->offsetSet( $file, $file );
        }
    }

    public static function getAll()
    {
        return self::$collection;
    }
}